"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
exports.__esModule = true;
var net_service_1 = require("./net.service");
var taro_1 = require("@tarojs/taro");
var _1 = require(".");
var HttpService = /** @class */ (function (_super) {
    __extends(HttpService, _super);
    function HttpService() {
        return _super.call(this) || this;
    }
    Object.defineProperty(HttpService, "Instance", {
        get: function () {
            return this._instance || (this._instance = new this());
        },
        enumerable: true,
        configurable: true
    });
    HttpService.prototype.sendData = function (cmdSign) {
        var userInfo = _1.cacheService.getSession();
        var header = {};
        if (userInfo) {
            if (userInfo.isCanary == undefined) {
                header.canary = 1;
            }
            else {
                header.canary = userInfo.isCanary;
            }
        }
        // header.canary = 1;
        var cmdData;
        if (taro_1["default"].getEnv() == taro_1["default"].ENV_TYPE.WEB) {
            cmdData = JSON.stringify(cmdSign);
        }
        else {
            cmdData = cmdSign;
        }
        ;
        return taro_1["default"].request({
            header: header,
            url: SERVER_URL + "/store/api",
            method: 'POST',
            data: cmdData
        });
    };
    return HttpService;
}(net_service_1.NetService));
var instance = HttpService.Instance;
exports["default"] = instance;
